<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>变量</title>

    <script>
        var a = 123            //全局变量
        var b = 1.23
        var c = -11
        var d = true
        var arr = {1,2,3,4}

        function test1() {
            var str = "hello"   //局部变量
            alert(str)
            a = "world"
        }




    </script>


</head>
<body>

<script>

    test1()
    alert(a)
    alert(b)
    alert(c)
    alert(d)
    alert(arr)

</script>

</body>
</html>